package com.xf.common.core.feign;

import com.xf.common.core.domain.DmpResult;
import com.xf.common.core.entity.dmp.DmpAuthUser;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author JoeyLiu
 * @create 2022-03-31 14:20
 */
@FeignClient(name = "userConsumer", url = "${dmp.saas.user.url.prefix}", configuration = OAuth2FeignRequestInterceptor.class)
public interface UserFeignConfig {

    String PREFIX = "/user";

    @GetMapping(value = PREFIX + "/getByUserName")
    DmpResult<List<DmpAuthUser>> getByUserName(@RequestBody DmpAuthUser name);

    @GetMapping(value = PREFIX + "/getByIds")
    DmpResult<List<DmpAuthUser>> getByIds(@RequestBody List<String> ids);

    @GetMapping(value = PREFIX + "/getById")
    DmpResult<DmpAuthUser> getById(Long id);

    @PostMapping(value = PREFIX + "/add")
    DmpResult addUser(@RequestBody DmpAuthUser user);

    @PostMapping(value = PREFIX + "/updata")
    DmpResult updataUser(@RequestBody DmpAuthUser user);


}
